package com.crealth;

import java.util.concurrent.CountDownLatch;


public class DayKPIMain {
	//private static Logger logger = Logger.getLogger("running_log");
	
	public static CountDownLatch threadSignal = new CountDownLatch(3);
	/*
	public static void main(String[] args) {
		try {
			Config.initConfig();
			MybatisManager.initSessionFactory();
		} catch (Exception e) {
			logger.error("init config error", e);
			System.exit(0);
		}		
		
		Date curd = new Date(System.currentTimeMillis());
		String strMonth = new SimpleDateFormat("yyyyMM").format(curd);
		String cdrTbName = "e_cdr_" + strMonth;
		String strDay = new SimpleDateFormat("yyyy-MM-dd").format(curd);
		logger.info("strDay: " + strDay);
		List<StaffDayKPIModel> kpils = StaffDayKPIDb.selectUserDayCall(cdrTbName, strDay);
		for (StaffDayKPIModel dayKpi : kpils) {
			Timestamp curDay = new Timestamp(curd.getTime());
			dayKpi.setCurDay(curDay);
			StaffDayKPIDb.insertUserDayCall(dayKpi);
		}
			
		logger.info("finished---------------");
		
		try {
			threadSignal.await();
		} catch (InterruptedException e) {
			logger.error("", e);
		}
		
	}	
	*/
	/*
	public static List<Date> historyDays = new ArrayList<Date>();	
	private static void getHistoryDays() {
        Calendar start = Calendar.getInstance();  
        start.set(2016, 4, 26);
        Long startTIme = start.getTimeInMillis();
        Calendar end = Calendar.getInstance();
        end.set(2016, 4, 1);
        Long endTime = end.getTimeInMillis();
        Long oneDay = 1000 * 60 * 60 * 24L;
        Long time = startTIme;
        while (time >= endTime) {
            Date d = new Date(time);
            historyDays.add(d);
            time -= oneDay;
        }
    }
	*/
	
}
